package com.gateway.video.rtsp.server.handler.support;

import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.http.FullHttpResponse;
import io.netty.handler.codec.http.HttpRequest;
import io.netty.util.concurrent.Promise;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public abstract class AbstractRtspRequest implements RtspRequest {
    @Override
    public void handler(ChannelHandlerContext ctx, HttpRequest request, Promise<FullHttpResponse> promise) {
        if(log.isDebugEnabled()) {
            log.debug("Video server receive request {}", request);
        }

        doHanlder(ctx, request, promise);
    }

    protected abstract void doHanlder(ChannelHandlerContext ctx, HttpRequest request, Promise<FullHttpResponse> promise);
}
